package com.chenjun.core.vo.sys;

import java.lang.reflect.InvocationTargetException;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.BeanUtils;

import com.chenjun.core.dao.generator.entity.SysGroup;

public class GroupDto extends SysGroup{
	
	 /**
     * 组织机构ID
     * db_column: id 
     */	
	private String id;
	/**
     * 组织机构编号 
     * db_column: code 
     */	
	@NotEmpty(message="组织机构编号不能为空")
	private String code;
    /**
     * 组织机构名称  
     * db_column: name 
     */	
	@NotEmpty(message="组织机构机构不能为空")
	private String name;
    /**
     * 角色备注说明  
     * db_column: note 
     */	
	private String note;
	
	/**
	 * 角色ID
	 */
	private String roleId;
	
	private String parentId;
	
	private String parentIds;
	
	private Integer sortIndex;
	
	private String level;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	public String getRoleId() {
		return roleId;
	}
	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	
	public String getParentId() {
		return parentId;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	public String getParentIds() {
		return parentIds;
	}
	public void setParentIds(String parentIds) {
		this.parentIds = parentIds;
	}
	public Integer getSortIndex() {
		return sortIndex;
	}
	public void setSortIndex(Integer sortIndex) {
		this.sortIndex = sortIndex;
	}
	public String getLevel() {
		return level;
	}
	public void setLevel(String level) {
		this.level = level;
	}
	/**
	 * 根据Bean获取Model模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static GroupDto getDtoByModel(SysGroup source) throws IllegalAccessException, InvocationTargetException{
		GroupDto target = new GroupDto();
		BeanUtils.copyProperties(source, target);
		return target;
	}
	
	
	/**
	 * 根据Model获取Bean模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static SysGroup getModelByDto(GroupDto source) throws IllegalAccessException, InvocationTargetException{
		SysGroup target = new SysGroup();
		BeanUtils.copyProperties(source, target);
		return target;
	}

}
